// components/common/user-asset/index.js
const componentBehavior = require('../../../behaviors/component');
const { COMPONENT_OPTIONS } = require('../../../constants/common');

Component({
    behaviors: [componentBehavior],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        name: {
            type: String,
            value: '余额',
        },
        showRecord: {
            type: Boolean,
            value: true,
        },
        recordName: {
            type: String,
            value: '余额明细',
        },
        allAmount: {
            type: Number,
            optionalTypes: [String],
            value: 0,
        },
        settleAmount: {
            type: Number,
            optionalTypes: [String],
            value: 0,
        },
        withdrawAmount: {
            type: Number,
            optionalTypes: [String],
            value: 0,
        },
    },
    data: {
    },
    methods: {
        handleBalanceAction() {
            this.triggerEvent('balance');
        },
        handleWithdrawAction() {
            this.triggerEvent('withdraw');
        },
    }
})
